﻿@model EmailAccount
<div class="page">
    <div class="pageContent">
        <form method="post" action="/Email/Account/@Model.Id" class="pageForm required-validate" onsubmit="return validateCallback(this, dialogAjaxDone);">
        <div class="pageFormContent">
            <div>
                <p>
                    <label>
                        状 态：
                    </label>
                    <select name="Status">
                        <option value="True">可用</option>
                        <option value="False">不可用</option>
                    </select>
                </p>
                <p>
                    <label>
                        分 类：
                    </label>
                    <select name="Category">
                        @foreach (var o in EmailAccount.CategoryDictionary)
                        {
                            <option value="@(o.Key)" @(ViewBag.Category == o.Key ? "selected=selected" : string.Empty)>@o.Value</option>
                        }
                    </select>
                </p>
                <p>
                    <label>
                        显示名称：
                    </label>
                    <input type="text" name="DisplayName" value="@(Model.DisplayName)" class="required"/>
                </p>
                <p>
                    <label>
                        邮箱帐号：
                    </label>
                    <input type="text" name="Email" value="@(Model.Email)" class="required"/>
                </p>
                <p>
                    <label>
                        SMTP主机：
                    </label>
                    <input type="text" name="Host" value="@(Model.Host)" class="required"/>
                </p>
                <p>
                    <label>
                        SMTP端口：
                    </label>
                    <input type="text" name="Port" value="@(Model.Port)" class="required"/>
                </p>
                <p>
                    <label>
                        用户名：
                    </label>
                    <input type="text" name="Username" value="@(Model.Username)" class="required"/>
                </p>
                <p>
                    <label>
                        密 码：
                    </label>
                    <input type="text" name="Password" value="@(Model.Password)" class="required"/>
                </p>
                <p>
                    <label>
                        EnableSsl：
                    </label>
                    <select name="EnableSsl">
                        <option value="True" @(Model.EnableSsl ? "selected=selected" : string.Empty)>使用</option>
                        <option value="False" @(!Model.EnableSsl ? "selected=selected" : string.Empty)>不使用</option>
                    </select>
                </p>
                <p>
                    <label>
                        UseDefaultCredentials：
                    </label>
                    <select name="UseDefaultCredentials">
                        <option value="True" @(Model.UseDefaultCredentials ? "selected=selected" : string.Empty)>
                            使用</option>
                        <option value="False" @(!Model.UseDefaultCredentials ? "selected=selected" : string.Empty)>
                            不使用</option>
                    </select>
                </p>
            </div>
        </div>
        <div class="formBar">
            <ul>
                <li>
                    <div class="buttonActive">
                        <div class="buttonContent">
                            <button type="button" onclick="this.form.onsubmit();">
                                保存</button></div>
                    </div>
                </li>
                <li>
                    <div class="button">
                        <div class="buttonContent">
                            <button type="button" onclick="$.pdialog.closeCurrent();">
                                取消</button></div>
                    </div>
                </li>
            </ul>
        </div>
        </form>
    </div>
</div>
